﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SQuestioninfo.cs" company="hoandd   ">
// hoandd
// </copyright>
// <summary>
//   Summary description for SQuestioninfo
// </summary>
// --------------------------------------------------------------------------------------------------------------------
using System.Collections.Generic;
using DotNetNuke.Common.Utilities;

namespace DesktopModules.Surveys
{
    /// <summary>
    /// Summary description for SurveyColtroller
    /// </summary>
    public class SurveyColtroller
    {
        public SurveyColtroller()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        #region Public Methods

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// adds an object to the database
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="obj">The SurveysInfo object</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------

        public static int AddSurveys(SurveyInfo obj)
        {
            return ((int)(DataProvider.Instance().AddSurveys(obj.OrgID, obj.Title, obj.Public, obj.DateCreated, obj.LastModified, obj.CreatedByUserID, obj.ModifiedByUserID, obj.Description)));
        }

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// deletes an object from the database
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="">The SurveyID of the Surveys</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public static void DeleteSurveys(int SurveyID)
        {
            DataProvider.Instance().DeleteSurveys(SurveyID);
        }

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// gets an object from the database
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="">TheSurveyID of Surveys</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public static SurveyInfo GetSurveys(int SurveyID)
        {
            return CBO.FillObject<SurveyInfo>(DataProvider.Instance().GetSurveys(SurveyID));
        }

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// gets an object from the database
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public static List<SurveyInfo> GetSurveyss()
        {
            return CBO.FillCollection<SurveyInfo>(DataProvider.Instance().GetSurveyss());
        }

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// saves an object to the database
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="obj">The SurveysInfo object</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public static void UpdateSurveys(SurveyInfo obj)
        {
            DataProvider.Instance().UpdateSurveys(obj.SurveyID, obj.OrgID, obj.Title, obj.Public, obj.DateCreated, obj.LastModified, obj.CreatedByUserID, obj.ModifiedByUserID, obj.Description);
        }

        #endregion Public Methods
    }
}